function foo(num){
    if(num===1){
        return 1;
    }
    else{
        return num*arguments.callee(num-1);
    }
}
var result = foo(4);
console.log("result",result);
